let mongoose =require('./db')
let dynamicSchema= mongoose.Schema({
    name:String,
    img:String,
    imgs:Array,
    content:String,
    phone:Number,
    start_time:{
        type:Date,
        default:Date.now
    },
    status:{
        type:Boolean,
        default:false        
    },
    hua:String,
    zan:Number,
    shou:Number,
    fen:Number,
    ping:Number,
})
let livingSchema= mongoose.Schema({
    content:String,
    end_time:{
        type:Date,
        default:Date.now
    },
    status:{
        type:Boolean,
        default:false
    },
    geng:String,
    liu:Number,
    fen:Number,
    guan:Number,
    num:Number,
    nid:{
        type:mongoose.Schema.Types.ObjectId,
        ref:'dynamic'
    }
})
let fieldSchema= mongoose.Schema({
    name:String,
    lei:String,
    tian:{
        type:Boolean,
        default:false
    },
    ren:String,
    end_time:{
        type:Date,
        default:Date.now
    },
    status:{
        type:Boolean,
        default:false
    },
})
let slideShowSchema= mongoose.Schema({
    name:String,
    title:String,
    img:String,
    end_time:{
        type:Date,
        default:Date.now
    },
    status:{
        type:Boolean,
        default:false
    },
})
let typeSchema= mongoose.Schema({
    value:String,
    lable:String,
})
let statusSchema= mongoose.Schema({
    value:String
})
let activeSchema= mongoose.Schema({
    di:String,
    xin:String,
    name:String,
    startTime:Date,
    endTime:Date,
    img:String,
    end_time:{
        type:Date,
        default:Date.now
    },
    tid:{
        type:mongoose.Schema.Types.ObjectId,
        ref:'type'
    },
    sid:{
        type:mongoose.Schema.Types.ObjectId,
        ref:'status'
    }
})
let biaoSchema= mongoose.Schema({
    name:String
})
let ztSchema= mongoose.Schema({
    value:String,
    lable:String
})
let videoSchema= mongoose.Schema({
    name:String,
    ren:String,
    publishTime:{
        type:Date,
        default:Date.now
    },
    bid:[{
        type:mongoose.Schema.Types.ObjectId,
        ref:'biao'
    }],
    zid:{
        type:mongoose.Schema.Types.ObjectId,
        ref:'zt'
    },
    cover:String,
    video:String,
})

let statumodel=mongoose.model('zt',ztSchema)
let activemodel=mongoose.model('active',activeSchema)
let typemodel=mongoose.model('type',typeSchema)
let statusmodel=mongoose.model('status',statusSchema)
let dynamicmodel=mongoose.model('dynamic',dynamicSchema)
let livingmodel=mongoose.model('living',livingSchema)
let fieldmodel=mongoose.model('field',fieldSchema)
let slideShowmodel=mongoose.model('slideShow',slideShowSchema)
let biaoModel=mongoose.model('biao',biaoSchema)
let videoModel=mongoose.model('video',videoSchema)
module.exports = {
    dynamicmodel,
    livingmodel,
    fieldmodel,
    slideShowmodel,
    activemodel,
    typemodel,
    statusmodel,
    biaoModel,
    videoModel,
    statumodel
   
}